package com.hatch.ui {	import flash.text.TextField;		import flash.text.TextFieldAutoSize;	
	import com.hatch.ui.Button;
	/**	 * @author hatch	 */	public class LabelButton extends Button 	{		protected var _label:String = 'LABEL';		public var label_txt:TextField;		private var _centerLabel:Boolean = false;
		override protected function addChildren():void 		{					super.addChildren();							if(!label_txt)			{				label_txt = new TextField();				addChild(label_txt);			}			label_txt.autoSize = TextFieldAutoSize.LEFT;			label_txt.selectable = false;			label_txt.mouseWheelEnabled = false;		}
		override public function draw():void		{			super.draw();			drawLabel();				}
		//--------------------------------------		//  Public Methods		//--------------------------------------				//--------------------------------------		//  Private / Protected Methods		//--------------------------------------
		protected function drawLabel():void 		{			if(label_txt != null) 			{				label_txt.text = label;				if(centerLabel) 				{					//Align.center(label_txt, width);					//Align.middle(label_txt, height);				}			}		}
		//--------------------------------------		//  Handlers		//-------------------------------------- 					//--------------------------------------		//  Getters / Setters		//--------------------------------------			override public function get width():Number		{			return label_txt.textWidth;		}
		override public function get height():Number		{			return label_txt.textHeight;				}
		public function get label():String 		{			return _label;		}
		public function set label(label:String):void 		{			_label = label;			invalidate();		}
		public function get centerLabel():Boolean 		{			return _centerLabel;		}
		public function set centerLabel(centerLabel:Boolean):void 		{			_centerLabel = centerLabel;			invalidate();		}	}}